import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
// import './util/rem' //适配  
import App from './App'
import store from './store'
import router from './router'
// import 'amfe-flexible'

import i18n from './lang' // internationalization
import { initThemeCssVariables, initTheme } from '@/utils/initialization'
import tools from './tools'
Vue.use(tools)
/**
 * 全局指令
 */
import permission from '@/directive/permission/index.js'
Vue.use(permission)
import dragDialog from '@/directive/el-drag-dialog' // base on element-ui
Vue.use(dragDialog)

initThemeCssVariables()
initTheme()

/**
 * 过滤特殊字符的指令
 */
import filterSpecialChar from '@/directive/v-filter-special-char'
Vue.use(filterSpecialChar)

// 富文本
import VueQuillEditor from 'vue-quill-editor'
// 富文本相关css
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

// set ElementUI lang to i18n
/**
 * 组件国际化
 */
Vue.use(ELEMENT, {
  size: 'small',
  zIndex: 3000,
  i18n: (key, value) => i18n.t(key, value)
})
/**
 * 统一全局提示
 */
Vue.prototype.$msgSuccess = function(msg, type,) {
  this.$message({ showClose: true, message: msg, type: type, duration: 3000, offset: window.screen.height / 2.7 })
}
/**
* 图片处理
*/
import { getImageUrl } from '@/utils/imageHandle'
Vue.prototype.$getImageUrl = getImageUrl
import Print from '@/utils/print'
Vue.use(Print)
Vue.use(VueQuillEditor,)
Vue.config.productionTip = false

window.vm = new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
